package adv41;

import java.lang.reflect.Array;
import java.util.Arrays;

/**
 * @author oldliu
 * @since 1.0
 */
public class ArrTest {
    public static void main(String[] args) {
        //20的double数组
        Object o = Array.newInstance(double.class, 20);
        //给数组的第一个赋值为1.5
        Array.setDouble(o,0,1.5);
        Array.setDouble(o,1,3.5);
        Array.setDouble(o,2,3.5);
        System.out.println(Array.getDouble(o,2));
        double d[]=(double[])o;
        System.out.println(Arrays.toString(d));
    }
}
